package org.batatasframework.support.database;

public class AliasGenerator {
	
	private final String prefix;
	private int count = 0;
	private String currentAlias;
	
	public AliasGenerator(String prefix){
		this.prefix = prefix;
	}
	
	public AliasGenerator(){
		this("z_");
	}
	
	public String generate(){
		currentAlias = prefix + count++;
		return currentAlias;
	}
	
	public int getIndex(){
		return count;
	}
	
	public String getAlias(){
		return currentAlias;
	}
}
